package com.zhijiaoyun.controller;

import java.io.IOException;
import java.util.List;

import com.zhijiaoyun.controller.base.BaseController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.zhijiaoyun.model.Test;

/**
 * @author shisfish
 * @date 2017/6/6
 */
@Controller
@RequestMapping(value = "test", produces = "application/json; charset=utf-8")
public class TestController extends BaseController {

	@ResponseBody
	@RequestMapping(value = "/test")
	public String searchByParams() {
		List<Test> resultDto = testService.selectByParams();
		return JSON.toJSONString(resultDto);
	}

	@ResponseBody
	@RequestMapping(value = "/change-picture/{type}")
	public String changePictrue(@PathVariable String type) throws IOException {
		testService.changePicture(type);
		return "SUCCESS";
	}


}
